<template>
  <div>
    <Button type="primary" size="small" @click="toRouterName" :disabled='stats'>查看</Button>
  </div>
</template>

<script>
  export default {
    name: 'ButtonShow',
    props: {
      rName: null,
      Project_id: null,
      stats: {
        default: false
      },
      viewOnly: null
    },
    data() {
      return {
        routerName: "",
      }
    },
    created() {
      this.routerName = this.rName
    },
    methods: {
      toRouterName() {
        // 点查看前把模态框关闭
        this.$store.commit('setModalState',false)
        this.$router.push({
          name: this.routerName,
          query: {
            ProjectId: this.Project_id,
            viewOnly: this.viewOnly
          }
        })
      }
    }
  }
</script>

<style scoped>

</style>